home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac: Not for Sale / Another.not.for.sale (Australia).iso / hold me in your arms / Virtual-Worlds / commercial / Sense8.spec < prev    next >
Internet Message Format  |  1993-10-26  |  9KB

  1. From dunc@well.sf.ca.us Sat Mar  6 12:19:12 1993
  2. Received: from nkosi.well.sf.ca.us by sunee.uwaterloo.ca with SMTP
  3.     id <AA05011>; Sat, 6 Mar 93 12:19:00 -0500
  4. Received: from well.sf.ca.us by nkosi.well.sf.ca.us (5.65c/SMI-4.1/nkosi-930216-1)
  5.     id AA18278; Sat, 6 Mar 1993 09:17:51 -0800
  6. Received: by well.sf.ca.us (5.65c/SMI-4.1/well-930216-1)
  7.     id AA28933; Sat, 6 Mar 1993 09:17:29 -0800
  8. Date: Sat, 6 Mar 1993 09:17:29 -0800
  9. From: Daniel R. Duncan <dunc@well.sf.ca.us>
  10. Message-Id: <199303061717.AA28933@well.sf.ca.us>
  11. To: broehl@sunee
  12. Subject: NFF stuff
  13. Status: OR
  14.  
  15. Hi Bernie,
  16.  
  17. Here is the NFF stuff as I posted it to BIX.
  18. =======================================================================
  19. The following information is courtesy of Ken Pimental of Sense8 
  20. Corporation, maker of the World Tool Kit, one of the standard 
  21. development environments for virtual reality applications.  
  22. The NFF standard is can accomodate file formats that are indigenous 
  23. to various platforms with a minimum of effort.  Sense8 has a 
  24. file conversion program to bring DXF files into NFF format.
  25.  
  26. They are putting this specification into the public domain.
  27.  
  28. ===========================================================================
  29.  
  30. Neutral ASCII File Format
  31.  
  32. Overview
  33.  
  34. The Sense8 neutral ASCII file format is a generic representation
  35. for polygonal geometry. The Sense8 WorldTool system can at present
  36. read geometry in any of the following file formats:
  37.  
  38. 1.      AutoCAD .DXF (through Release 11)
  39.  
  40. 2.      Sculpt-3d
  41.  
  42. 3.      Caligari
  43.  
  44. 4.      Videoscape
  45.  
  46. In order to import other geometry into WorldToolKit, users may
  47. write translators to transform their proprietary format into the
  48. neutral ASCII file format, which can then be read directly.
  49. Thus, the NFF format serves as in interface between modellers
  50. which cannot write geometry in any of the forms accepted by
  51. WorldToolKit.
  52.  
  53. In the NFF file format, objects are represented as sets of
  54. polygons, and polygons are ordered collections of vertices.
  55. Polygons have colors and can optionally have other attributes
  56. specified.  Objects can optionally be named.
  57.  
  58. The file must begin with a line containing the string "nff".
  59. (This is used to WTK to determine the type of file.)  There
  60. follows an optional viewpoint specification associated with
  61. the file, and a set of one or more object specifications.
  62. All lines must be terminated by a linefeed character, but the
  63. PC end-of-line convention CR-LF is also supported.
  64. (Note: the CR-LF will be read in, but it won't be written out.
  65. Only LFs are written out to an NFF file).
  66.  
  67. The optional viewpoint is specified as two lines, of the form:
  68. viewpos x y z   viewdir x y z      specifying the viewpoint's
  69. location and view direction, respectively.
  70.  
  71. By default, an NFF file containing more than one object will
  72. load as a single object, which contains all of the file's objects.
  73. To tell WorldToolKit to load each NFF object as a distinct
  74. WorldToolKit object, put the word "distinct" after the viewpoint
  75. information and before any object specifications.  See the
  76. object_new function for an explanation of how to load multiple
  77. objects from a single NFF file.
  78.  
  79. Each object specification start with a line of text giving the
  80. object's symbolic name.  The next line contains the number of
  81. vertices in the object.  Vertex x,y,z coordinates, as real numbers,
  82. follow one per line.  The next line contains the number of polygons
  83. in the object.  Polygon specification lines follow, one for each
  84. polygon.
  85.  
  86. The Vertex coordinate lines should contain 3 real numbers (as could
  87. be read in C with a "%f %f %f" format string).  One or more spaces
  88. or other whitespace must seperate the numbers.
  89.  
  90. Each polygon specification line is of the form
  91.  
  92.      <# of vertices> <vertex list> <color> [both] [<texture name>
  93.      [<attributes>]] [id=n] [<portal>]
  94.  
  95. The line starts with an integer giving the number of vertices in
  96. the polygon.  The number of indices follow, each indexing a vertex
  97. coordinate. (Zero indicates the first vertex).  After the vertex
  98. indices is a color designator given in hexadecimal as a number in
  99. the range 0x0 to 0xfff.  The high order 4 bits represents the red
  100. intensity, the middle 4 bits the green, and the low order 4 bits
  101. the blue.
  102.  
  103. The optional string "both" indicates that both sides of the polygon
  104. are to be visible.  The default is only the front face, by the
  105. right hand rule.
  106.  
  107. Optionally, a texture name and attributes can be specified for the
  108. polygon. (When texturing is on, color is ignored for the textured
  109. polys since the surface properties come from the texture.)
  110. Texture names give the file containing the bitmap to be used as a
  111. texture, and specify whether the texture is to be shaded or
  112. transparent.  Shaded textures have their brightness affected by
  113. the lights present in the model.  Transparent textures are rendered
  114. so that all black pixels in the source bitmap are transparent when
  115. the texture is applied to a polygon.
  116. Texture names begin with the character "_".  The character following
  117. the "_" indicates the type of texture, according to the following:
  118.  
  119.         _v_             plain Vanilla texture (no shading)
  120.  
  121.         _s_             Shaded texture
  122.  
  123.         _t_             transparent texture
  124.  
  125. For example, a texture named "_v_rug" causes a texture from a file
  126. named "rug" to be used.  A texture named "_s_rug" would apply the
  127. same texture, but shaded based on lighting.  At present, these
  128. three options are mutually exclusive.
  129.  
  130. You may also specify texture attributes immediately after the
  131. texture name.  These take the format:
  132.  
  133.         [rot <value>] [scale <value>] [trans <value> <value>]
  134.  
  135. and specify texture rotation, scaling and translation, respectively.
  136. Any or none of these attributes may appear, but they must be placed
  137. after the texture name.
  138.  
  139.  
  140. Regardless of the order of the attributes, at the time the polygon
  141. is loaded, they will always be applied in the following order:
  142. rotation, scaling, translation.  Since the NFF file's description
  143. of these texture attributes does not uniquely specify every
  144. possible transformation, if you require that files saved by WTK
  145. retain their exact transformation when loaded back in, apply your
  146. attributes in the same order (rotation, scaling, translation)
  147. before saving.
  148.  
  149. Using the  optional polygon ID token "id=n", you can assign an
  150. integer value "n" to any polygon in your NFF file (example: id=567).
  151. Then, from within your WorldToolKit application, you can use
  152. the WTpoly_getid function to retreive the ID number for the polygon
  153. in question.  You can use this feature to "link" polygons in your
  154. NFF file with polygons in your application. This is extremely
  155. useful for texture animations or other special tricks.
  156.  
  157. Finally, a portal name can be specified for a polygon.
  158. Portal names begin with a "-" and contain the name of the Universe
  159. to be loaded when the portal is crossed.
  160.  
  161. This is a sample polygon specification line, illustrating all
  162. possible options:
  163.  
  164. 5 0 1 2 3 4 0xff0 both _s_rug rot 1.0 scale 0.5 trans 1.0 1.0 id=5 -rugworld
  165.  
  166.  
  167. This polygon has 5 vertices and is colored yellow, although the
  168. yellow will not appear unless you are rendering without textures.
  169. Both sides of the polygon are visible, and a shaded rug texture is
  170. applied.  The rug texture is rotated 1 radian, scaled to half-size,
  171. and translated by (1.0,1.0) in (u,v) space. The polygon`s ID number
  172. is set to 5 and if the viewpoint crosses this polygon, the universe
  173. "rugworld" will be loaded.
  174.  
  175. NFF files may have comments placed on any line.  The characters "//"
  176. introduce a comment.  All characters on the line following the "//"
  177. are ignored.  The NFF reader is also very flexible with white space;
  178. any number of tabs or spaces are allowed before, between and after
  179. words in the file.
  180.  
  181.  
  182.  
  183. Sample ASCII File
  184.  
  185. The following is an example of a simple ASCII File containing a
  186. simple cube structure. Some polygons of the cube are textured and
  187. some are not.
  188.  
  189.  
  190.  
  191. nff     // This is the first word of any NFF file.
  192.  
  193.  
  194.  
  195. // The following two lines are optional.
  196.  
  197. viewpos 0.0 0.0 0.0     // Viewpoint is at the origin
  198.  
  199. viewdir 0.0 0.0 1.0     // and looking straight forward.
  200.  
  201.  
  202.  
  203. OutObject               // Name of the object.
  204.  
  205. 8                       // Number of vertices.
  206.  
  207. 3.0 3.0 -3.0            // Vertex info.
  208.  
  209. 3.0 -3.0 -3.0
  210.  
  211. -3.0 -3.0 -3.0
  212.  
  213. -3.0 3.0 -3.0
  214.  
  215. 3.0 3.0 3.0
  216.  
  217. 3.0 -3.0 3.0
  218.  
  219. -3.0 -3.0 3.0
  220.  
  221. -3.0 3.0 3.0
  222.  
  223. 6   // Number of polygons.
  224.  
  225. 4 0 1 2 3 0xf00 both     // 0xf00 is the color, in this case, Red
  226.  
  227. 4 7 6 5 4 0x0f0 both     // "both" sides of the cube's faces are visible
  228.  
  229. 4 0 4 5 1 0x00f both     // so it is visible even from inside the cube.
  230.  
  231. 4 1 5 6 2 0xff0 both _S_wings         // A shaded texture called "wings"
  232.  
  233. 4 2 6 7 3 0xfff both _T_fish rot 1.0  // A rotated, transparent fish texture
  234.  
  235. //a portal to universe "kproom"
  236.  
  237. 4 3 7 4 0 0x000 both _V_kproom -kproom
  238.  
  239. ============================================================================
  240.  
  241. looks like it all got through with no line wrap.
  242.  
  243. Talk to you soon.
  244.  
  245. dunc
  246.  
  247.